<div class="contactos index">
<?php
	echo $javascript->link('prototype.js',false);
	echo $javascript->link('scriptaculous.js?load=effects',false);	
?>
<p><span style="font-weight:normal; font-size:20px;"><?php echo $perfil;?></span><br/><br/></p>
<p><span style="font-weight:normal; font-size:18px;">Contactos</span></p>
<?php echo $ajax->div('contactos'); ?>
	<table>
		<tr>
			<th>Con qui&eacute;n</th><th>Para Qu&eacute;</th><th>Frecuencia</th><th>Tipo Contacto</th>
		</tr>
	<?php foreach ($contactos as $contacto): ?>
		<tr>
			<td><?php echo $contacto['Contacto']['con_quien']; ?></td><td><?php echo $contacto['Contacto']['para_que']; ?></td>
			<td><?php echo ($contacto['Contacto']['frecuencia']=="0")? "Diario":"De acuerdo a necesidades"; ?></td>
			<td><?php echo ($contacto['Contacto']['tipo']=="0")? "Interno":"Externo"; ?></td>
			<td><?php echo $this->Html->link($this->Html->image('edit.png', array('alt'=> __('Editar', true), 'border' => '0')),
										'edit/'.$contacto['Contacto']['id'],array('escape' => false, 'title'=>'Editar Contacto')); ?>
				<?php echo $this->Html->link($this->Html->image('delete.png', array('alt'=> __('Eliminar', true), 'border' => '0')),
										'delete/'.$contacto['Contacto']['id'].'/'.$perfile_id,array('escape' => false, 'title'=>'Eliminar Contacto'), sprintf(__('Esta seguro de eliminar: %s?', true), $contacto['Contacto']['con_quien'])); ?>			

			</td>
		</tr>		
	<?php endforeach; ?>
	</table>
<?php echo $ajax->divEnd('contactos'); ?>
<br/>
<h3>A&ntilde;adir Contacto</h3>
	
		<?php echo $ajax->form('/add', 'post', array('update' => 'contactos')); ?>
		<table>
		<tr>
			<td><?php echo $form->input('tipo',array('type'=>'select','options'=>array('Interno','Externo')));?></td>
			<td></td>
			<td><?php echo $form->input('frecuencia',array('type'=>'select','options'=>array('Diario','De acuerdo a necesidades')));?></td>
		</tr>
		<tr>
			<td><?php echo $form->input('con_quien');?></td>
			<td></td>
			<td><?php echo $form->input('para_que');?></td>
		</tr>
		<tr>
			<td colspan="3">
			<?php							
				echo $form->input('perfile_id',array('type'=>'hidden','value'=>$perfile_id));
				echo $form->submit('A&ntilde;adir',array('escape'=>false)); 
			?>
			</td>		
		</tr>
		</table>
		<?php echo $form->end();?>
</div>
<div class="actions">
	<?php echo $this->Form->menu($this->Access->getMy('id'),$this->Access->getMy('group_id'));?>
</div>